package com.ruoyi.hospital.utils.interceptors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/*
* 医生 接口拦截器
* */
@Configuration
public class DocWebConfig implements WebMvcConfigurer {

    @Autowired
    private DocInterceptor docInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加拦截器，并设置拦截的路径
        registry.addInterceptor(docInterceptor)
                .addPathPatterns("/doc/**") // 指定拦截的接口路径
        .excludePathPatterns("/doc/login","/doc/logout"); // 指定排除的接口路径
    }

}
